
<@override name="content">
    <div class="panel panel-default ux-panel">
        <div class="panel-heading">
            <h3 class="panel-title">微信配置</h3>
        </div>
        <div class="panel-body">

            <form id="myForm" class="form-horizontal" role="form" action="${base}/wechat/mergeConfig" method="POST">
                <input type="hidden" name="id" value="${(entity.id)!}">
                <div class="form-group">
                    <label class="col-sm-2 control-label">WID</label>
                    <div class="col-sm-6">
                        <label class="control-label"><span id="wid">${(entity.wid)!}</span></label>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">账号名称</label>
                    <div class="col-sm-6">
                        <input class="form-control" id="name" name="name" type="text" value="${(entity.name)!}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">公众号id</label>
                    <div class="col-sm-6">
                        <input class="form-control" id="appid" name="appid" type="text" value="${(entity.appid)!}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">公众号Secret</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="appsecret" type="text"  value="${(entity.appsecret)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">公众号URL</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="url" type="text" value="${(entity.url)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">公众号Token</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="token" type="text" value="${(entity.token)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">企业微信ID</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="corpid" type="text" value="${(entity.corpid)!}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">企业微信AgentId</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="agentid" type="text" value="${(entity.agentid)!}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">企业微信Secret</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="corsecret" type="text" value="${(entity.corsecret)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">小程序ID</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="mappid" type="text" value="${(entity.mappid)!}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">小程序Secret</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="mappsecret" type="text" value="${(entity.mappsecret)!}">
                    </div>
                </div>

                <div id="_osAlertTip"></div>

                <div class="form-group">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-6">
                        <button type="button" class="btn btn-primary" onclick="doSubmit();">保 存</button>
                    </div>
                </div>

            </form>
        </div>
    </div>
</@override>

<script type="text/javascript">
    function doSubmit(){
        //jquery form
        $('#myForm').ajaxSubmit({
            datatyep: "json",
            success: function(resp){
                var resp = $.parseJSON(resp);
                if(resp.errcode == 0){
                    $('#id').val(resp.data.id);
                    $('#wid').html(resp.data.wid);
                    Modal.tipSuccess("保存成功");//提示成功
                }else{
                    Modal.tipSuccess("保存失败");//提示失败
                }
            },
            error: function(xhr){
                 Modal.tipSuccess("保存成功");//提示失败
            }
        });
    }
</script>

<!-- extends 一定要写在页面最下方 -->
<@extends name="_base.html"/>

